# Maintainer: Felix Yan <felixonmars@archlinux.org>

pkgname=python-flask-login
pkgver=0.6.2
pkgrel=3
pkgdesc="User session management for Flask"
arch=('any')
url="https://pythonhosted.org/Flask-Login/"
license=('MIT')
depends=('python' 'python-flask' 'python-werkzeug')
makedepends=('python-build' 'python-installer' 'python-wheel')
checkdepends=('python-nose' 'python-blinker' 'python-semantic-version' 'python-asgiref')
source=("https://github.com/maxcountryman/flask-login/archive/$pkgver/$pkgname-$pkgver.tar.gz")
sha512sums=('b286272ad5f7de2cfc913bee4a3eac46e4c1ce274bb12467009e1abae422f1a855aa49fd898778b8a2e937eebe9fbb387af11815267a2bc120cde943939111ec')

build() {
  cd flask-login-$pkgver
  python -m build --wheel --no-isolation
}

check() {
  cd flask-login-$pkgver
  nosetests3
}

package() {
  cd flask-login-$pkgver
  python -m installer --destdir="$pkgdir" dist/*.whl

  install -Dm 644 LICENSE -t "$pkgdir"/usr/share/licenses/$pkgname
  install -Dm 644 README.md -t "$pkgdir"/usr/share/docs/$pkgname
}
